import React, { Component } from "react";
import { withRouter } from "react-router-dom";
import MyNoLogin from "../../components/myNoLogin/MyNoLogin"
import MyLoginB from "../../components/myLoginB/MyLoginB"
class My extends Component {
  state={
    is_login:false,
    token:sessionStorage.getItem("token")
  }
 
  componentDidMount(){
   
    let token = sessionStorage.getItem("token");
    console.log(token)
    if(token){
      this.setState({
        is_login:true
      })
    }
  }
  render() {

    return (
     <div>
       {this.state.is_login? <MyNoLogin></MyNoLogin>:<MyLoginB></MyLoginB>}
      
     </div>
    );
  }
}
export default withRouter(My);
